<!--
 * @Description: 
 * @Autor: Huang Yingming
 * @LastEditors: Ming
 * @LastEditTime: 2021-11-18 14:01:24
-->
<template>
  <nav-bar></nav-bar>
  <router-view v-slot="{ Component }">
    <keep-alive>
      <component :is="Component"
                 v-if="$route.meta.keepAlive"></component>
    </keep-alive>
    <component :is="Component"
               v-if="!$route.meta.keepAlive"></component>
  </router-view>
</template>

<script>
import $api from './api'
import { onMounted, provide } from 'vue'
import NavBar from './components/NavBar.vue'
export default {
  components: { NavBar },
  setup () {
    provide('$api', $api)
    onMounted(async () => {
      const res = await $api.crawnovel.searchResult({
        keyword: 'asd'
      })
      console.log(res);
    })
  },
}
</script>

<style lang="scss">
@import url('./assets/style/general.scss');
</style>
